package model;

import android.os.Parcel;
import android.os.Parcelable;
import android.util.Log;

public class Message {
private static final String TAG = "Message";
	
	private String from;
	
	private String content;
	
	public static final Parcelable.Creator<Message> CREATOR = new Parcelable.Creator<Message>() {
		
		public Message createFromParcel(Parcel source) {
			Log.v(TAG, "createFromParcel");
			return new Message(source);
		} 

		public Message[] newArray(int size) {
			Log.v(TAG, "newArray");
			return new Message[size];
		}
	};
	
	public Message() {
	}

	public Message(Parcel source) {
		readFromParcel(source);
	}

	public String getFrom() {
		return from;
	}

	public void setFrom(String from) {
		this.from = from;
	}

	public String getContent() {
		return content;
	}

	public void setContent(String content) {
		this.content = content;
	}

	public int describeContents() {
		return 0;
	}

	public void writeToParcel(Parcel out, int arg1) {
		Log.v(TAG, "writeToParcel");
		out.writeString(from);
		out.writeString(content);
	}
	
	public void readFromParcel(Parcel in) {
		Log.v(TAG, "readFromParcel");
		from = in.readString();
		content = in.readString();
		Log.d(TAG, "from = " + from + ", content = " + content);
	}

}
